<?php

namespace Text;

class TextModel {

    /**
     * 抛出错误
     * 
     * @param int $code
     */
    public static function getText($code) {
        $lang      = \Our\Common::getLang();
        $langModel = "\Text\Config\\" . $lang . 'Model';
        $config    = $langModel::getText();
        if (empty($config[$code])) {
            throw new \Exception('编码' . $code . '的相应' . $lang . '文本信息没有设置');
        }

        return $config[$code];
    }

}
